﻿using System.Collections.Generic;
using DAL;
using Model;

namespace BLL
{
    public class SchoolService
    {
        private readonly SchoolRepository _schoolRepository;

        public SchoolService()
        {
            _schoolRepository = new SchoolRepository();
        }

        public void AddSchool(School school)
        {
            _schoolRepository.AddSchool(school);
        }

        public void DeleteSchool(int schoolId)
        {
            _schoolRepository.DeleteSchool(schoolId);
        }

        public void UpdateSchool(School school)
        {
            _schoolRepository.UpdateSchool(school);
        }

        public List<School> GetSchools(string name)
        {
            return _schoolRepository.SearchSchoolsByName(name);
        }
    }
}
